import html2text
from requests_html import HTMLSession
import pyperclip

'''掘金---html转md
读取文本中的html内容转md
'''

path = r'C:\Users\ASUS\Desktop'
content = ''
with open(path + r'\html.txt', encoding='utf-8') as file_object:
    content = file_object.read()

# print(content)
md = html2text.html2text(content)
print(md)
with open(path + r'\html-md.md', 'w', encoding='utf-8') as f:
    f.write(md)